package com.kuzlak.cms.bean;


import com.baomidou.mybatisplus.core.metadata.IPage;

public class MyPage<T> {

    private long total;


    private long current;

    private long size;
    private long pages;
    private Object list;

    public static <M> MyPage<M> parsePage(IPage<M> page) {
        MyPage<M> myPage = new MyPage<M>();
        myPage.setCurrent(page.getCurrent());
        myPage.setSize(page.getSize());
        myPage.setTotal(page.getTotal());
        myPage.setPages(page.getPages());
        myPage.setList(page.getRecords());
        return myPage;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public long getCurrent() {
        return current;
    }

    public void setCurrent(long current) {
        this.current = current;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public Object getList() {
        return list;
    }

    public void setList(Object list) {
        this.list = list;
    }

    public long getPages() {
        return pages;
    }

    public void setPages(long pages) {
        this.pages = pages;
    }

    @Override
    public String toString() {
        return "MyPage{" +
                "total=" + total +
                ", current=" + current +
                ", size=" + size +
                ", pages=" + pages +
                ", list=" + list +
                '}';
    }
}